package com.starlinkdt.quartz.config;

import com.starlinkdt.quartz.util.AbstractQuartzJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;


/**
 * 初始化任务: 获取spring容器中的上下文，并设置给AbsRetryJob
 */
@Component
public class JobInitConfig {

    @Autowired
    private ApplicationContext applicationContext;

    @PostConstruct
    public void init() {
        AbstractQuartzJob.setApplicationContext(applicationContext);
    }
}
